#include "SendMessageDialog.h"
#include "ui_SendMessageDialog.h"

SendMessageDialog::SendMessageDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::SendMessageDialog)
{
    ui->setupUi(this);
    connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(onAccept()));
}

SendMessageDialog::~SendMessageDialog()
{
    delete ui;
}




void SendMessageDialog::onAccept() {
    bool ok = false;
    QxPLMessage message = QxPLMessage::createMessage(ui->messageEdit->toPlainText(), &ok);
    if(ok) {
        emit this->messageCreated(message);
        this->accept();
    }
    else {
        qDebug() << "remove issues";
    }

}

